/*
 * @Description: 存为草稿
 */
import { getComment } from '@/handles/handle-list/summary/modules/continue-submit/helper';
import api from '@/api';
import {useBaseInfoWithOut} from "@/store/modules/base-info";
const useBaseInfo = useBaseInfoWithOut();

export async function saveDraft() {
  //校验附件
  if (!useBaseInfo.validateAttachmentUploading()) {
    return;
  }
  await api.summarySubmitDraft(getComment());
  this.$message.success($.i18n('collaboration.common.draft.success'));
}

export default function () {
  return new Promise((resolve) => {
    saveDraft.call(this);
    resolve();
  });
}
